﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TyNetCoreBlog.Helpers;
using TyNetCoreBlog.Models.Entities;
using TyNetCoreBlog.Repository.RepositoryBase;
using TyNetCoreBlog.Helpers;

namespace TyNetCoreBlog.Repository
{
    public interface IBlogRepository : IRepositoryBase<Blog>, IRepositoryBase2<Blog, int>
    {
        /// <summary>
        /// 分页获取
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns></returns>
        Task<PagedList<Blog>> GetAllAsync(BlogResourceParameters parameters);


        /// <summary>
        /// 通过tagid获取博客
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<Blog>> GetBlogByTagIdAsync(int tagId);

        /// <summary>
        /// 获取前几条blog
        /// </summary>
        /// <param name="topNum"></param>
        /// <returns></returns>
        Task<IEnumerable<Blog>> GetTopBlogs(int topNum);

        /// <summary>
        /// 获取热门博客
        /// </summary>
        /// <param name="topNum"></param>
        /// <returns></returns>
        Task<IEnumerable<Blog>> GetHotBlogs(int topNum);

        //获取所有博客年份
        Task<List<int>> GetYearsAsync();
        //按年归档
        Task<Dictionary<int, IEnumerable<Blog>>> BlogArchiveAsync(List<int> years);

    }
}
